      SUBROUTINE SETUP
      RETURN
      END
C   HS5
      SUBROUTINE EF(X,FX)
      INCLUDE 'FUCO.INC'
      DOUBLE PRECISION X(NX),FX
Cf2py intent(in) x
Cf2py intent(out) fx
      ICF=ICF+1
      FX=DSIN(X(1)+X(2))+(X(1)-X(2))**2-1.5D0*X(1)+2.5D0*X(2)+1.D0
      RETURN
      END
      SUBROUTINE EGRADF(X,GRADF)
      INCLUDE 'FUCO.INC'
      DOUBLE PRECISION X(NX),GRADF(NX)
Cf2py intent(in) x
Cf2py intent(out) gradf
      ICGF=ICGF+1
      GRADF(1)=DCOS(X(1)+X(2))+2.D0*(X(1)-X(2))-1.5D0
      GRADF(2)=DCOS(X(1)+X( 2))-2.D0*(X(1)-X(2))+2.5D0
      RETURN
      END
      SUBROUTINE EH(I,X,HXI)
      INCLUDE 'FUCO.INC'
      INTEGER I
      DOUBLE PRECISION X(NX),HXI
Cf2py intent(in) x
Cf2py intent(in) i
Cf2py intent(out) gxi
      CRES(I)=CRES(I)+1
      RETURN
      END
      SUBROUTINE EGRADH(I,X,GRADHI)
      INCLUDE 'FUCO.INC'
      INTEGER I
      DOUBLE PRECISION X(NX),GRADHI(NX)
Cf2py intent(in) x
Cf2py intent(in) i
Cf2py intent(out) gradhi
      CGRES(I)=CGRES(I)+1
      RETURN
      END
      SUBROUTINE EG(I,X,GXI)
      INCLUDE 'FUCO.INC'
      INTEGER I
      DOUBLE PRECISION X(NX),GXI
Cf2py intent(in) x
Cf2py intent(in) i
Cf2py intent(out) gxi
      IF ( GUNIT(1,I+NH) .EQ. -1 )CRES(I+NH)=CRES(I+NH)+1      
      GOTO (100,200,300,400),I
  100 CONTINUE
      GXI=X(1)+1.5D0
      RETURN
  200 CONTINUE
      GXI=4.D0-X(1)
      RETURN
  300 CONTINUE
      GXI=X(2)+3.D0
      RETURN
  400 CONTINUE
      GXI=3.D0-X(2)
      RETURN
      END
      SUBROUTINE EGRADG(I,X,GRADGI)
      INCLUDE 'FUCO.INC'
      INTEGER I,K
      DOUBLE PRECISION X(NX) ,GRADGI(NX)
Cf2py intent(in) x
Cf2py intent(in) i
Cf2py intent(out) gradgi
      IF ( GUNIT(1,I+NH) .EQ. 1 )RETURN
      CGRES(I+NH)=CGRES(I+NH)+1
      DO      10      K=1,2
      GRADGI(K)=0.D0
   10 CONTINUE
      GOTO (100,200,300,400),I
  100 CONTINUE
      GRADGI(1)= 1.D0
      RETURN
  200 CONTINUE
      GRADGI(1)=-1.D0
      RETURN
  300 CONTINUE
      GRADGI(2)= 1.D0
      RETURN
  400 CONTINUE
      GRADGI(2)=-1.D0
      RETURN
      END
      BLOCK DATA
      INCLUDE 'BLOCO.INC'
      INTEGER I,J
      DATA NAME/'HS5 '/
      DATA X/ NX*0.0D0/
      DATA N/ 2/ , NH/0/ , NG/4 /
      DATA DEL0/1.00D0/ ,TAU0/1.00D0/ ,TAU/.1D0/
      DATA ((GUNIT(I,J),I=1,3),J=0,4)/-1,0,0,
     F           1,1,1,1,1,-1,1,2,1,1,2,-1/
      END
